<?php

namespace Biz\pockets\constInterface;

use Doraemon\model\AdmUserType;
use Doraemon\model\Member;

/**
 * 超级盲盒配置
 * Interface BlindBoxConfig
 * @package Biz\pockets\constInterface
 */
interface BlindBoxConfig
{
    /**
     * 盲盒总数量
     */
    const MAX_BOX = 5;
    /**
     * 盲盒信息
     */
    const BLIND_BOX_MAP = [
        1 => [
            'box_id' => 1,//盲盒id
            'icon' => 'https://img.haohaozhu.cn/Op-imageShow/b0d8430h50et04V00qifsri?iv=1',//盲盒样式
            'icon_activity' => 'http://img.hhz1.cn/Op-imageShow/9e7e930h50et0BI00qo911i?iv=1',
        ],
        2 => [
            'box_id' => 2,
            'icon' => 'https://img.haohaozhu.cn/Op-imageShow/1def630h50et0K900qifsrj?iv=1',
            'icon_activity' => 'http://img.hhz1.cn/Op-imageShow/c0e2830h50et0hc00qo911j?iv=1',
        ],
        3 => [
            'box_id' => 3,
            'icon' => 'https://img.haohaozhu.cn/Op-imageShow/d3c3e30h50et0wF00qifsrj?iv=1',
            'icon_activity' => 'http://img.hhz1.cn/Op-imageShow/adfef30h50et0OD00qo911j?iv=1',
        ],
        4 => [
            'box_id' => 4,
            'icon' => 'https://img.haohaozhu.cn/Op-imageShow/c07c830h50et0FH00qifsrj?iv=1',
            'icon_activity' => 'http://img.hhz1.cn/Op-imageShow/a329230h50et0xS00qo911j?iv=1',
        ],
        5 => [
            'box_id' => 5,
            'icon' => 'https://img.haohaozhu.cn/Op-imageShow/c0cdc30h50et0la00qifsrj?iv=1',
            'icon_activity' => 'http://img.hhz1.cn/Op-imageShow/ec57630h50et0Jp00qo911k?iv=1',
        ],
        6 => [
            'box_id' => 6,
            'icon' => 'https://img.haohaozhu.cn/Op-imageShow/4313730ku0ku0IW00qvgdvk?iv=1',
            'icon_activity' => 'http://img.hhz1.cn/Op-imageShow/0df6630h50et09300qo911k?iv=1'
        ]
    ];

    const POINT_BOX_PRIZE_ID = -1;//积分奖品id
    const CUE_CARD_BOX_PRIZE_ID = -2;//提示卡奖品id
    const EMPTY_BOX_PRIZE_ID = 0;//空盒子奖品id

    /**
     * 每人每天最多打开盲盒3次
     */
    const USER_EVERY_DAY_MAX_BOX = 3;

    /**
     * 每人每天免费打开盲盒1次
     */
    const USER_EVERY_DAY_MAX_BOX_FREE = 1;

    /**
     * 来源-盲盒
     */
    const SOURCE_BLIND_BOX = 0;

    /**
     * 来源-H5活动页
     */
    const SOURCE_H5_ACTIVITY = 1;

    /**
     * 每人每天最多能换2次盲盒
     */
    const USER_EVERY_DAY_CHANGE_BOX = 2;
    /**
     * 每人每天最多兑换2张提示卡
     */
    const USER_EVERY_DAY_EXCHANGE_CUE_CARD = 2;
    /**
     * 每人每天最多使用2次提示卡
     */
    const USER_EVERY_DAY_USE_CUE_CARD = 2;

    /**
     * 打开一个盲盒需要10积分
     */
    const OPEN_BOX_POINT = 10;
    /**
     * 更换一次盲盒需要3积分
     */
    const CHANGE_BOX_POINT = 3;
    /**
     * 兑换一张提示卡需要3积分
     */
    const EXCHANGE_CUE_CARD_POINT = 3;

    /**
     * 关注品牌获取3积分
     */
    const TASK_FOLLOW_BRAND_POINT = 3;

    /**
     * 领取任务-每日签到2积分
     */
    const TASK_SIGN_POINT = 2;

    /**
     * 领取任务-收藏一个商品3积分
     */
    const TASK_FAVORITE_GOODS_POINT = 3;

    /**
     * 领取任务-分享一个商品3积分
     */
    const TASK_SHARE_GOODS_POINT = 3;

    /**
     * 领取任务-点赞3积分
     */
    const TASK_LIKE_POINT = 3;

    /**
     * 领取任务-发布带wiki的内容或则品牌标签 15积分
     */
    const TASK_RELATE_WIKI_POINT = 15;

    /**
     * 领取任务-参与话题10积分
     */
    const TASK_RELATE_TOPIC = 10;


    /**
     * 奖品总价值最低数（500元）
     */
    const MIN_PRIZE_TOTAL_PRICE = 500;

    /**
     * 用户抽奖等级配置
     */
    const USER_BLIND_LEVEL = [
        9 => [
            'fans' => [],
            'user_type' => [
                'type' => [
                    Member::AUTH_USER_BRAND,//品牌用户
                ],
                'auth_tag' => [
                    AdmUserType::AUTH_TAG_WAIT_DESIGNER,//待认证设计师
                    AdmUserType::AUTH_TAG_WAIT_BRAND,//待认证品牌
                    AdmUserType::AUTH_TAG_SUSPECTED_BUSINESS,//疑似商业用户,
                ],
                'quality' => [
                    AdmUserType::B1,
                    AdmUserType::B2,
                    AdmUserType::B3,
                ],
                'quality2' => [
                    AdmUserType::XL,
                ]
            ]
        ],
        8 => [
            'fans' => [//1000以下
                'min' => 0,
                'max' => 1000,
            ],
            'user_type' => [
                'type' => [
                    Member::AUTH_USER_DESIGNER//设计师
                ],
                'auth_tag' => [],
                'quality' => [],
                'quality2' => []
            ]
        ],
        7 => [
            'fans' => [//1000+
                'min' => 1001,
                'max' => 99999999,
            ],
            'user_type' => [
                'type' => [
                    Member::AUTH_USER_DESIGNER//设计师
                ],
                'auth_tag' => [],
                'quality' => [],
                'quality2' => []
            ]
        ],
        6 => [
            'fans' => [//0-10
                'min' => 0,
                'max' => 10,
            ],
            'user_type' => [
            ]
        ],
        5 => [
            'fans' => [//11-300
                'min' => 11,
                'max' => 300,
            ],
            'user_type' => [
            ]
        ],
        4 => [
            'fans' => [//301-1000
                'min' => 301,
                'max' => 1000,
            ],
            'user_type' => [
            ]
        ],
        3 => [
            'fans' => [//1001-5000
                'min' => 1001,
                'max' => 5000,
            ],
            'user_type' => [
            ]
        ],
        2 => [
            'fans' => [//5001-1w
                'min' => 5001,
                'max' => 10000,
            ],
            'user_type' => [
            ]
        ],
        1 => [
            'fans' => [//1w+
                'min' => 10001,
                'max' => 99999999,
            ],
            'user_type' => [
            ]
        ],
    ];

    /**
     * 奖品价值等级配置
     */
    const PRIZE_BLIND_LEVEL = [
        'A' => [
            'price' => [//大于4000元
                'min' => 4001,
                'max' => 9999999
            ],
            'lottery_weight' => [
                1 => [1, 18],
                2 => [1, 15],
            ],
            'last_lottery_weight' => [//最后一天活动概率
                1 => [1, 90],
                2 => [1, 75],
            ]
        ],
        'B' => [
            'price' => [//2001-4000元
                'min' => 2001,
                'max' => 4000,
            ],
            'lottery_weight' => [
                1 => [19, 38],
                2 => [16, 30],
                3 => [1, 10],
            ],
            'last_lottery_weight' => [
                1 => [91, 190],
                2 => [76, 150],
                3 => [1, 50],
            ]
        ],
        'C' => [
            'price' => [//1001-2000元
                'min' => 1001,
                'max' => 2000,
            ],
            'lottery_weight' => [
                1 => [39, 58],
                2 => [31, 45],
                3 => [11, 20],
            ],
            'last_lottery_weight' => [
                1 => [191, 290],
                2 => [151, 225],
                3 => [51, 100],
            ]
        ],
        'D' => [
            'price' => [//501-1000元
                'min' => 501,
                'max' => 1000,
            ],
            'lottery_weight' => [
                1 => [59, 80],
                2 => [46, 65],
                3 => [21, 36],
                4 => [1, 8],
            ],
            'last_lottery_weight' => [
                1 => [291, 400],
                2 => [226, 325],
                3 => [101, 180],
                4 => [1, 16],
            ]
        ],
        'E' => [
            'price' => [//201-500元
                'min' => 201,
                'max' => 500,
            ],
            'lottery_weight' => [
                1 => [81, 105],
                2 => [66, 88],
                3 => [37, 56],
                4 => [9, 26],
            ],
            'last_lottery_weight' => [
                1 => [401, 525],
                2 => [326, 440],
                3 => [181, 280],
                4 => [17, 52],
            ],
        ],
        'F' => [
            'price' => [//101-200元
                'min' => 101,
                'max' => 200,
            ],
            'lottery_weight' => [
                1 => [106, 130],
                2 => [89, 108],
                3 => [57, 76],
                4 => [27, 44],
                5 => [1, 12],
                7 => [1, 12],
            ],
            'last_lottery_weight' => [
                1 => [526, 650],
                2 => [441, 540],
                3 => [281, 380],
                4 => [53, 88],
                5 => [1, 12],
                7 => [1, 12],
            ],
        ],
        'G' => [
            'price' => [//51-100元
                'min' => 51,
                'max' => 100,
            ],
            'lottery_weight' => [
                1 => [131, 140],
                2 => [109, 118],
                3 => [77, 94],
                4 => [45, 59],
                5 => [13, 24],
                6 => [1, 5],
                7 => [13, 24],
            ],
            'last_lottery_weight' => [
                1 => [651, 700],
                2 => [541, 590],
                3 => [381, 470],
                4 => [89, 118],
                5 => [13, 24],
                6 => [1, 5],
                7 => [13, 24],
            ]
        ],
        'H' => [
            'price' => [//11-50元
                'min' => 11,
                'max' => 50,
            ],
            'lottery_weight' => [
                1 => [141, 150],
                2 => [119, 128],
                3 => [95, 112],
                4 => [60, 74],
                5 => [25, 36],
                6 => [6, 11],
                7 => [25, 36],
            ],
            'last_lottery_weight' => [
                1 => [701, 740],
                2 => [591, 640],
                3 => [471, 560],
                4 => [119, 148],
                5 => [25, 36],
                6 => [6, 11],
                7 => [25, 36],
            ]
        ],
        'I' => [//2-10元
            'price' => [
                'min' => 2,
                'max' => 10,
            ],
            'lottery_weight' => [
                1 => [151, 650],
                2 => [129, 628],
                3 => [113, 612],
                4 => [75, 574],
                5 => [37, 536],
                6 => [12, 511],
                7 => [37, 536],
            ],
            'last_lottery_weight' => [
                1 => [741, 900],
                2 => [641, 900],
                3 => [561, 900],
                4 => [149, 574],
                5 => [37, 536],
                6 => [12, 511],
                7 => [37, 536],
            ]
        ],
        'J' => [//1元
            'price' => [
                'min' => 1,
                'max' => 1,
            ],
            'lottery_weight' => [
                1 => [651, 999],
                2 => [629, 999],
                3 => [613, 999],
                4 => [575, 999],
                5 => [537, 999],
                6 => [512, 999],
                7 => [537, 999],
                8 => [1, 999],
                9 => [1, 999]
            ],
            'last_lottery_weight' => [
                1 => [901, 999],
                2 => [901, 999],
                3 => [901, 999],
                4 => [575, 999],
                5 => [537, 999],
                6 => [512, 999],
                7 => [537, 999],
                8 => [1, 999],
                9 => [1, 999]
            ]
        ],
    ];

    const RAND_MAX = 1000;
}